package org.niugang.service;

import org.niugang.config.FeignLoggerConfig;
import org.niugang.fallback.UserServiceFallBack;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

/**
 * 定义服务绑定接口
 *
 */
//声明调用的服务
//value:调用服务的名
//fallback：配置服务降级类
//configuration:定制客户端的自定义@configuration。可以包含对组成客户端的片段的重写@Bean定义
@FeignClient(value = "microservice-user", fallback = UserServiceFallBack.class, configuration = FeignLoggerConfig.class)
public interface UserService {

	/**
	 * 获取用户信息
	 * 
	 * @return
	 */
	@RequestMapping(value = "/userservice/user", method = RequestMethod.GET)
	String getUserInfo();

}
